home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 August / Personal_Computer_World_Aug_97.iso / dxrs / cdxpcw08.dxr / 00025_CDXSearch .ls < prev    next >
Encoding:
Text File  |  1997-05-22  |  4.3 KB  |  101 lines

  1. on CDXSearch
  2.   global CDXSearchBegin, CDXSearchSprite, CDXWhichTypesList, CDXABBList, CDXresultlist, CDpageselect, CDrecordsfound, CDXSelected, CDXSub, CDXSomething, CDXWordsearchdata, CDXFirstResSprite, CDXLastResSprite, CDXHelpOnStage
  3.   if rollOver(CDXSearchSprite) or (CDXSub = 3) then
  4.     if CDXSearchBegin = 0 then
  5.       set the castNum of sprite CDXSearchSprite to the number of member "SearchNowTwo"
  6.       updateStage()
  7.     end if
  8.     repeat while rollOver(CDXSearchSprite) or (CDXSub = 3)
  9.       if (the mouseDown and (CDXSearchBegin = 0)) or (CDXSub = 3) then
  10.         if CDXSearchBegin = 0 then
  11.           set CDXSub to 2
  12.           set the castNum of sprite CDXSearchSprite to the number of member "SearchNowThree"
  13.           set CDXSearchBegin to 1
  14.           updateStage()
  15.         end if
  16.         exit repeat
  17.       end if
  18.     end repeat
  19.     if CDXSearchBegin = 0 then
  20.       set the castNum of sprite CDXSearchSprite to the number of member "SearchNowOne"
  21.     else
  22.       if CDXSearchBegin = 1 then
  23.         repeat with a = 30 to 35
  24.           set the castNum of sprite a to the number of member "CDDot"
  25.           set the locH of sprite a to 2000
  26.           set the locV of sprite a to 2000
  27.         end repeat
  28.         set the castNum of sprite 36 to the number of member "CDDot"
  29.         set the locH of sprite 36 to 2000
  30.         set CDXHelpOnStage to 0
  31.         repeat with a = CDXFirstResSprite to CDXLastResSprite
  32.           set the castNum of sprite a to -1
  33.           set the locH of sprite a to 2000
  34.           set the locV of sprite a to 2000
  35.         end repeat
  36.         updateStage()
  37.         set CDXWordsearchdata to 0
  38.         set CDcountwords to the number of words in field "CDWordSearchField"
  39.         set CDXWordsearchdata to word 1 to CDcountwords of line 1 of field "CDWordSearchField"
  40.         set CDXWhichTypesList to list()
  41.         set CDpageselect to 0
  42.         repeat with d = 1 to count(CDXTopMenuList)
  43.           set selectedtext to getAt(getAt(CDXTopMenuList, d), 4)
  44.           set wordNum to the number of words in field selectedtext
  45.           if wordNum > 1 then
  46.             set WhichSel to word 1 of field selectedtext && word 2 of field selectedtext
  47.           else
  48.             set WhichSel to word 1 of field selectedtext
  49.           end if
  50.           if (WhichSel <> EMPTY) and (WhichSel <> "select all") and (WhichSel <> "all") then
  51.             repeat with g = 1 to the number of chars in WhichSel
  52.               put charToNum(char g of WhichSel)
  53.               if (charToNum(char g of WhichSel) > 96) and (charToNum(char g of WhichSel) < 123) then
  54.                 set currentasciivalue to charToNum(char g of WhichSel)
  55.                 set currentasciivalue to currentasciivalue - 32
  56.                 put numToChar(currentasciivalue) into char g of WhichSel
  57.               end if
  58.             end repeat
  59.             add(CDXWhichTypesList, [getAt(getAt(CDXTopMenuList, d), 14), WhichSel])
  60.           end if
  61.         end repeat
  62.         if (count(CDXWhichTypesList) > 0) or (CDXWordsearchdata <> EMPTY) then
  63.           set CDXSelected to 1
  64.           set CDXresultlist to list()
  65.           CDXBeginFileFlexSearching()
  66.         else
  67.           set the castNum of sprite 34 to the number of member "CDNothingSel"
  68.           set the boxType of member "CDNothingSel" to #fixed
  69.           set the margin of member "CDNothingSel" to 2
  70.           set the border of member "CDNothingSel" to 1
  71.           if the machineType > 200 then
  72.             set the textFont of member "CDNothingSel" to "arial"
  73.           else
  74.             set the textFont of member "CDNothingSel" to "Geneva"
  75.           end if
  76.           set the textStyle of member "CDNothingSel" to "plain"
  77.           set the textSize of member "CDNothingSel" to 12
  78.           set the loc of sprite 34 to point(30, 134)
  79.           set the castNum of sprite 35 to the number of member "NothingGraphic"
  80.           set the loc of sprite 35 to point(217, 156)
  81.           updateStage()
  82.           set CDXSelected to 0
  83.         end if
  84.         set CDrecordsfound to count(CDXresultlist)
  85.         if CDrecordsfound > 18 then
  86.           set CDpageselect to 1
  87.         end if
  88.         if (CDXSelected = 1) and (CDXSomething = 1) then
  89.           CDXFieldResults()
  90.           CDXdisplay()
  91.         end if
  92.         repeat while the mouseDown
  93.         end repeat
  94.         set the castNum of sprite CDXSearchSprite to the number of member "SearchNowOne"
  95.         set CDXSearchBegin to 0
  96.       end if
  97.     end if
  98.     updateStage()
  99.   end if
  100. end
  101.